<?php
import( 'de.ceus-media.framework.krypton.core.Template' );
import( 'de.ceus-media.framework.krypton.core.Registry' );
/**
 *	Template Component.
 *	@package		mv2.view.component
 *	@extends		Framework_Krypton_Core_Template
 *	@uses			Framework_Krypton_Core_Registry
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			02.03.2007
 *	@version		0.2
 */
/**
 *	Template Component.
 *	@package		mv2.view.component
 *	@extends		Framework_Krypton_Core_Template
 *	@uses			Framework_Krypton_Core_Registry
 *	@author			Christian Würker <Christian.Wuerker@CeuS-Media.de>
 *	@since			02.03.2007
 *	@version		0.2
 */
class View_Component_Template extends Framework_Krypton_Core_Template
{
	/**
	 *	Constructor.
	 *	@access		public
	 *	@param		string		$filename		File Name of Template
	 *	@param		array		$elements		Array of Elements to set in Template
	 *	@return		void
	 */
	function __construct( $filename, $elements = null )
	{
		$config		= Framework_Krypton_Core_Registry::getStatic( 'config' );

		//  --  BASICS: base path, account path and file name  --  //
		$basepath	= $config['paths']['templates'];
		$basename	= str_replace( ".", "/", $filename ).".html";

		//  --  FILE URI CHECK  --  //
		$filename	= $filename = $basepath.$basename;		//  fallback: base path
		if( !file_exists( $filename ) )							//  check file
			throw new Framework_Krypton_Exception_IO( "Neither Account Template nor Base Template '".$filename."' is existing." );	
		parent::__construct( $filename, $elements );
/*		try
		{
		}
		catch( Exception_IO $e )
		{
			thr
			$messenger	= Framework_Krypton_Core_Registry::getStatic( 'messenger' );
			$messenger->noteFailure( $e->getMessage() );
		}
*/	}
}  
?>
